package geektime.spring.springbucks.mapper;

import geektime.spring.springbucks.mybatismodel.OrderCoffee;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface OrderCoffeeMapper {
    @Insert("insert into t_order_coffee (coffee_order_id, items_id)"
            + "values (#{coffeeOrderId}, #{itemsId})")
    int save(OrderCoffee OrderCoffee);

    @Delete("delete from torder_coffee where coffee_order_id = #{coffeeOrderId}")
    int delete(OrderCoffee orderCoffee);

    @Select("select * from t_order_coffee where coffee_order_id = #{coffeeOrderId}")
    List<OrderCoffee> findByCoffeeOrderId(@Param("coffeeOrderId") String coffeeOrderId);

}
